A practical mode system for recursive definitions

نویسندگان

چکیده

In call-by-value languages, some mutually-recursive value definitions can be safely evaluated to build recursive functions or cyclic data structures, but (let rec x = + 1) contain vicious circles and their evaluation fails at runtime. We propose a new static analysis check the absence of such runtime failures. present set declarative inference rules, prove its soundness with respect reference source-level semantics Nordlander, Carlsson, Gill (2008), show that it (right-to-left) directed into an algorithmic in surprisingly simple way. Our implementation this replaced existing used by OCaml programming language, fragile syntactic/grammatical criterion which let several subtle bugs slip through as language kept evolving. document issues arise when advanced features real-world functional (exceptions first-class modules, GADTs, etc.) interact safety checking for definitions.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Type Inference for Recursive Definitions

We consider type systems that combine universal types, recursive types, and object types. We study type inference in these systems under a rank restriction, following Leivant's notion of rank. To motivate our work, we present several examples showing how our systems can be used to type programs encountered in practice. We show that type inference in the ranksystem is decidable for and undecidab...

متن کامل

Positive Inductive-Recursive Definitions

A new theory of data types which allows for the definition of types as initial algebras of certain functors Fam(C) → Fam(C) is presented. This theory, which we call positive inductive-recursive definitions, is a generalisation of Dybjer and Setzer’s theory of inductive-recursive definitions within which C had to be discrete — our work can therefore be seen as lifting this restriction. This is a...

متن کامل

A Unifying Approach to Recursive and Co-recursive Definitions

In type theory based logical frameworks, recursive and corecursive definitions are subject to syntactic restrictions that ensure their termination and productivity. These restrictions however greately decrease the expressive power of the language. In this work we propose a general approach for systematically defining fixed points for a broad class of well given recursive definition. This approa...

متن کامل

Primitively (Co)recursive Definitions for Isabelle/HOL

Isabelle/HOL has recently been enriched with a definitional package for datatypes and codatatypes. The package introduces the specified types and derives auxiliary constants and characteristic theorems, notably (co)recursors and (co)induction principles. We now introduce support for high-level specifications of (co)recursive functions, in the form of three commands: primrec, primcorec, and prim...

متن کامل

Rank 2 Intersection for Recursive Definitions

Let ` be an intersection type system. We say that a term is `-simple (or just simple when the system ` is clear from the context) if system ` can prove that it has a simple type. In this paper we propose new typing rules and algorithms that are able to type (with rank-2 intersection types) recursive definitions that are not simple. Typing rules for assigning intersection types to (nonsimple) re...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

ژورنال

عنوان ژورنال: Proceedings of the ACM on programming languages

سال: 2021

ISSN: ['2475-1421']

DOI: https://doi.org/10.1145/3434326